package com.meiyue.bean.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * MeiyueJavaProject
 * com.meiyue.bean.entity
 * Created by Chris Chen
 * 2017/9/14
 * Explain:
 */
@Entity
@Table(name = "test_drivers", schema = "test_yuedao", catalog = "")
public class TestDriversEntity {
    private int id;
    private String lastName;
    private String firstName;
    private String idNum;
    private int homeProvinceId;
    private int homeCityId;
    private String homePostalCode;
    private String homeAddress;
    private String driversLicense;
    private int driversLicenseProvcityId;
    private Timestamp driversLicenseExpiration;
    private Timestamp driversLicenseInitDate;
    private int driversLicenseTypeId;
    private int vehicleId;
    private int ratingId;
    private int statusId;
    private Timestamp dob;
    private Integer driverType;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "last_name", nullable = false, length = 50)
    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    @Basic
    @Column(name = "first_name", nullable = false, length = 50)
    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    @Basic
    @Column(name = "id_num", nullable = false, length = 50)
    public String getIdNum() {
        return idNum;
    }

    public void setIdNum(String idNum) {
        this.idNum = idNum;
    }

    @Basic
    @Column(name = "home_province_id", nullable = false)
    public int getHomeProvinceId() {
        return homeProvinceId;
    }

    public void setHomeProvinceId(int homeProvinceId) {
        this.homeProvinceId = homeProvinceId;
    }

    @Basic
    @Column(name = "home_city_id", nullable = false)
    public int getHomeCityId() {
        return homeCityId;
    }

    public void setHomeCityId(int homeCityId) {
        this.homeCityId = homeCityId;
    }

    @Basic
    @Column(name = "home_postal_code", nullable = true, length = 200)
    public String getHomePostalCode() {
        return homePostalCode;
    }

    public void setHomePostalCode(String homePostalCode) {
        this.homePostalCode = homePostalCode;
    }

    @Basic
    @Column(name = "home_address", nullable = true, length = 200)
    public String getHomeAddress() {
        return homeAddress;
    }

    public void setHomeAddress(String homeAddress) {
        this.homeAddress = homeAddress;
    }

    @Basic
    @Column(name = "drivers_license", nullable = false, length = 50)
    public String getDriversLicense() {
        return driversLicense;
    }

    public void setDriversLicense(String driversLicense) {
        this.driversLicense = driversLicense;
    }

    @Basic
    @Column(name = "drivers_license_provcity_id", nullable = false)
    public int getDriversLicenseProvcityId() {
        return driversLicenseProvcityId;
    }

    public void setDriversLicenseProvcityId(int driversLicenseProvcityId) {
        this.driversLicenseProvcityId = driversLicenseProvcityId;
    }

    @Basic
    @Column(name = "drivers_license_expiration", nullable = true)
    public Timestamp getDriversLicenseExpiration() {
        return driversLicenseExpiration;
    }

    public void setDriversLicenseExpiration(Timestamp driversLicenseExpiration) {
        this.driversLicenseExpiration = driversLicenseExpiration;
    }

    @Basic
    @Column(name = "drivers_license_init_date", nullable = true)
    public Timestamp getDriversLicenseInitDate() {
        return driversLicenseInitDate;
    }

    public void setDriversLicenseInitDate(Timestamp driversLicenseInitDate) {
        this.driversLicenseInitDate = driversLicenseInitDate;
    }

    @Basic
    @Column(name = "drivers_license_type_id", nullable = false)
    public int getDriversLicenseTypeId() {
        return driversLicenseTypeId;
    }

    public void setDriversLicenseTypeId(int driversLicenseTypeId) {
        this.driversLicenseTypeId = driversLicenseTypeId;
    }

    @Basic
    @Column(name = "vehicle_id", nullable = false)
    public int getVehicleId() {
        return vehicleId;
    }

    public void setVehicleId(int vehicleId) {
        this.vehicleId = vehicleId;
    }

    @Basic
    @Column(name = "rating_id", nullable = false)
    public int getRatingId() {
        return ratingId;
    }

    public void setRatingId(int ratingId) {
        this.ratingId = ratingId;
    }

    @Basic
    @Column(name = "status_id", nullable = false)
    public int getStatusId() {
        return statusId;
    }

    public void setStatusId(int statusId) {
        this.statusId = statusId;
    }

    @Basic
    @Column(name = "dob", nullable = true)
    public Timestamp getDob() {
        return dob;
    }

    public void setDob(Timestamp dob) {
        this.dob = dob;
    }

    @Basic
    @Column(name = "driver_type", nullable = true)
    public Integer getDriverType() {
        return driverType;
    }

    public void setDriverType(Integer driverType) {
        this.driverType = driverType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TestDriversEntity that = (TestDriversEntity) o;

        if (id != that.id) return false;
        if (homeProvinceId != that.homeProvinceId) return false;
        if (homeCityId != that.homeCityId) return false;
        if (driversLicenseProvcityId != that.driversLicenseProvcityId) return false;
        if (driversLicenseTypeId != that.driversLicenseTypeId) return false;
        if (vehicleId != that.vehicleId) return false;
        if (ratingId != that.ratingId) return false;
        if (statusId != that.statusId) return false;
        if (lastName != null ? !lastName.equals(that.lastName) : that.lastName != null) return false;
        if (firstName != null ? !firstName.equals(that.firstName) : that.firstName != null) return false;
        if (idNum != null ? !idNum.equals(that.idNum) : that.idNum != null) return false;
        if (homePostalCode != null ? !homePostalCode.equals(that.homePostalCode) : that.homePostalCode != null)
            return false;
        if (homeAddress != null ? !homeAddress.equals(that.homeAddress) : that.homeAddress != null) return false;
        if (driversLicense != null ? !driversLicense.equals(that.driversLicense) : that.driversLicense != null)
            return false;
        if (driversLicenseExpiration != null ? !driversLicenseExpiration.equals(that.driversLicenseExpiration) : that.driversLicenseExpiration != null)
            return false;
        if (driversLicenseInitDate != null ? !driversLicenseInitDate.equals(that.driversLicenseInitDate) : that.driversLicenseInitDate != null)
            return false;
        if (dob != null ? !dob.equals(that.dob) : that.dob != null) return false;
        if (driverType != null ? !driverType.equals(that.driverType) : that.driverType != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (lastName != null ? lastName.hashCode() : 0);
        result = 31 * result + (firstName != null ? firstName.hashCode() : 0);
        result = 31 * result + (idNum != null ? idNum.hashCode() : 0);
        result = 31 * result + homeProvinceId;
        result = 31 * result + homeCityId;
        result = 31 * result + (homePostalCode != null ? homePostalCode.hashCode() : 0);
        result = 31 * result + (homeAddress != null ? homeAddress.hashCode() : 0);
        result = 31 * result + (driversLicense != null ? driversLicense.hashCode() : 0);
        result = 31 * result + driversLicenseProvcityId;
        result = 31 * result + (driversLicenseExpiration != null ? driversLicenseExpiration.hashCode() : 0);
        result = 31 * result + (driversLicenseInitDate != null ? driversLicenseInitDate.hashCode() : 0);
        result = 31 * result + driversLicenseTypeId;
        result = 31 * result + vehicleId;
        result = 31 * result + ratingId;
        result = 31 * result + statusId;
        result = 31 * result + (dob != null ? dob.hashCode() : 0);
        result = 31 * result + (driverType != null ? driverType.hashCode() : 0);
        return result;
    }
}
